package br.com.busgpsapp.util;

import br.com.busgpsapp.R;
import android.app.ProgressDialog;
import android.content.Context;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.widget.ImageView;

public class CustomProgressDialog extends ProgressDialog
{

	private AnimationDrawable animation;

	public CustomProgressDialog(Context context)
	{
		super(context);
	}

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.custom_progress_dialog);
		ImageView la = (ImageView) findViewById(R.id.animation);
		la.setBackgroundResource(R.drawable.animation_list);
		animation = (AnimationDrawable) la.getBackground();
	}

	@Override
	public void show()
	{
		super.show();
		animation.start();
	}

	@Override
	public void dismiss()
	{
		super.dismiss();
		animation.stop();
	}

}
